<?php
require_once './data/users.php';
if(isset($_POST["submit"])) {
    $a= false;
    for ($i = 0; $i < count($users); $i++) {
        if (strcmp($_POST["username"], $users[$i]["username"]) == 0 && strcmp($_POST["password"], $users[$i]["password"]) == 0) {
            $a= true;
            break;
        } else {
            $a= false;
        }
    }
    if ($a== true) {
        echo $_POST["username"] . " Dang nhap thanh cong";
    }
    else {
        echo $_POST["username"] . " Dang nhap khong hop le";
    }
}
?>